package com.x.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.x.common.bo.JsonResult;
import com.x.common.bo.PageObject;
import com.x.sys.entity.SysLog;
import com.x.sys.service.SysLogService;

@RestController
@RequestMapping("/log/")
public class SysLogController {
	@Autowired
	private SysLogService sysLogService;
	
	@RequestMapping("doFindPageObjects")
	public JsonResult doFindPageObjects(String username,
			Integer pageCurrent) {
		PageObject<SysLog> pageObjects = 
				sysLogService.findPageObjects(username, pageCurrent);
		return new JsonResult(pageObjects);
	}
	/**
	 * 业务:队选中的日志进行删除
	 * url:localhost:8080/log/doDeleteObjects?ids=[1,2,3]
	 * 参数:ids=[1,2,3]
	 * 返回值:delete ok
	 */
	@RequestMapping("doDeleteObjects")
	public JsonResult doDeleteObjects(Integer...ids) {
		sysLogService.deleteObjects(ids);
		return  new JsonResult("delete ok");
	}

}
